<!doctype html>
<html>
<head>
    <title>菜单添加</title>
    <?php $this->load->module('admin/index/page_header');?>
</head>
<body>
<div class="wrap">
    <div id="home_toptip"></div>
    <div class="nav">
        <ul>
            <li><a href="<?php echo site_url('weixin/admin/menu_index');?>">菜单管理</a></li>
            <li <?php if(empty($row)){?> class="current"<?php }?>><a href="<?php echo site_url('weixin/admin/menu_add');?>">添加菜单</a></li>
            <?php if(!empty($row)):?>
                <li class="current"><a href="javascript:;">编辑菜单</a></li>
            <?php endif;?>
        </ul>
    </div>
    <div class="table_full">
        <form class="formvalidate" action="" method="post">
            <div class="h_a">添加菜单</div>
            <div class="table_full">
                <table width="100%">
                    <col class="th" />
                    <col/>
                    <tbody>
                    <tr>
                        <th>父级菜单</th>
                        <td>
                            <select name="Form[parent_id]" class="select rounded" style="font-family: 'Courier New', Courier, monospace;">
                                <option value="0">作为一级菜单</option>
                                <?php echo $select;?>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>菜单名称</th>
                        <td><input type="text" name="Form[name]" class="input rounded" size="40" value="<?php echo !empty($row['name']) ? $row['name'] :''?>" validate="{required:true}" /></td>
                    </tr>
                    <tr>
                        <th>响应动作类型</th>
                        <td>
                            <select name="Form[type]">
<!--                                <option --><?php //echo @$row['type'] == '' ? 'selected' : '';?><!-- value="">-</option>-->
<!--                                <option --><?php //echo @$row['type'] == 'click' ? 'selected' : '';?><!-- value="click">click事件</option>-->
                                <option <?php echo @$row['type'] == 'view' ? 'selected' : '';?> value="view">view链接</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>事件KEY或链接地址</th>
                        <td>

                            <input name="Form[keyurl]" type="text" class="input" size="40" value="<?php echo (!empty($row['key']) || !empty($row['url'])) ? $row['url'] :'';?>" />
                        <span class="fun_tips" style="color:orangered">如果选择“链接地址”必须以http://开头</span>
                        </td>
                    </tr>
                    <tr>
                        <th>排序</th>
                        <td><input name="Form[displayorder]" type="number" class="input" size="10" value="<?php echo !empty($row['displayorder']) ? intval($row['displayorder']) :0?>" /></td>
                    </tr>
                    <tr>
                        <th>&nbsp;</th>
                        <td>
                            <?php if(!empty($row)):?>
                                <input type="hidden" name="id" value="<?php echo !empty($row['id']) ? $row['id'] :0?>" />
                            <?php endif;?>
                            <button type="submit" class="btn btn_submit J_ajax_submit_btn">提交</button>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </form>
    </div>
</div>
</body>
</html>